package com.wsd.CallableTask;

import com.wsd.service.WechatService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.Callable;

/**
 * @author zhangqizeng
 */
public class WxOpenIdTaskQuery implements Callable<List<String>> {

    private List<String> ids;

    @Autowired
    private WechatService wechatService;

    public WxOpenIdTaskQuery(){
        this.ids = new ArrayList<>();
    }

    public List<String> getIds() {
        return ids;
    }

    public void setIds(List<String> ids) {
        this.ids = ids;
    }


    /**
     * Computes a result, or throws an exception if unable to do so.
     *
     * @return computed result
     * @throws Exception if unable to compute a result
     */
    @Override
    public List<String> call() throws Exception {
        return wechatService.queryOpenIds(ids);
    }

}
